<template>
	<view class="">
		<!-- <view class="head_box">
			<view class="order-nav x-f">
				<view class="nav-item y-f" v-for="(nav, index) in typeNav" :key="index" @tap="onNav(nav, index)">
					<view class="item-title">{{ nav.title }}</view>
					<text class="nav-line" :class="{ 'line-active': zfType == index }"></text>
				</view>
			</view>
		</view> -->
		<view class="con">
			<!-- <view class="list jui_flex jui_flex_justify_between" v-for="(item, index) in list" :key="index" @tap="jump(`/pages/user/wallet/rechargeDetail?id=${item.id}`)"> -->
			<view class="list jui_flex jui_flex_justify_between" v-for="(item, index) in list" :key="index">
				<view class="left" style="text-align: center;">
					<view class="text" style="color: #666;font-size: 28upx;margin-top: 16upx;">类型</view>
					<view class="text paytype">
						<!-- template< v-if="item.paytype == 'zfb'">支付宝</template>
						<template v-if="item.paytype == 'wx'">微信</template>
						<template v-if="item.paytype == 'bank'">银行卡</template> -->
					{{item.typename}}
					</view>
				</view>
				<view>
					<view class="text" style="color: #666;font-size: 28upx;margin-top: 16upx; text-align: center;">
						{{item.createTime}}
					</view>
				</view>
				<view class="right">
					<view class="text jui_fc_zhuse">
						金额：{{item.paymoney || 0}}
					</view>
				</view>
			</view>
			<empty position="jui_fixed" v-if="list.length < 1"></empty>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				typeNav: [{
						title: '全部',
						type: 1
					},
					{
						title: '审核中',
						type: 2
					},
					{
						title: '已完成',
						type: 3
					},
					{
						title: '已驳回',
						type: 4
					}
				],
				zfType: 0,
				q: {
					type: 1,
					pageNumber: 1,
					pageSize: 10
				},
				isLoading: true,
				hasMore: true,
				loadStatus: '',
				list: []
			}
		},
		onLoad(opt){
			let _token = uni.getStorageSync('token');
			this.q.type = opt.type
			this.q._token = _token
			this.getList();
		},
		onReachBottom(){
			if (this.hasMore) {
				this.q.pageNumber += 1;
				this.getList();

			}
		},
		methods: {
			getList() {
				this.isLoading = true;
				this.$api.getDetailList(this.q).then(res => {
					this.isLoading = false;
					if (res.data && res.data.length != 0) {
						this.list = res.data;
						this.hasMore = true;
						this.loadStatus = '';
					} else {
						this.list = []
						this.hasMore = false;
						this.loadStatus = 'over';
					}
				});
			},
			onNav(nav, index) {
				this.zfType = index;
				this.q.type = nav.type;
				this.list = [];
				this.q.pageNumber = 1;
				this.getList();
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}
	.paytype {
		margin: 4px auto 0;
		width: 100%;
		text-align: center;
		border-radius: 18rpx;
		// border: 1px solid #00c4ff;
	}
	.con {
		width: 100%;
		margin-top: 36upx;
		margin: 0 auto;

		.list {
			// width: 100%;
			margin-bottom: 30upx;
			background: #fff;
			border-radius: 10upx;
			padding: 30upx 40rpx;
			display: flex;
			align-items: center;
			border-bottom: 1px solid #f4f4f4;

			image {
				width: 100upx;
				height: 100upx;
				border-radius: 100%;
			}

			.right {
				text-align: right;
				font-size: 32upx;
				color: #333;
				margin-left: 30upx;

				text {
					color: $zhuse;
				}
			}
		}
	}

	.order-nav {
		background: #fff;
		height: 80rpx;

		.nav-item {
			flex: 1;

			.item-title {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(51, 51, 51, 1);
				line-height: 76rpx;
			}

			.nav-line {
				width: 38rpx;
				height: 8rpx;
				background: #fff;
				border-radius: 4px;
			}

			.line-active {
				background: $zhuse;
			}
		}
	}
</style>
